package cn.usian.mapper;

import cn.usian.jyzx.model.dto.h5.UserLoginDto;
import cn.usian.jyzx.model.entity.user.UserAddress;
import cn.usian.jyzx.model.entity.user.UserInfo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserMapper {
    @Insert("insert into user_info (username, password, nick_name, phone, avatar, sex) VALUES (#{username},#{password},#{nickName},#{phone},#{avatar},#{sex})")
    void insert(UserInfo userInfo);

    @Select("select * from user_info where username=#{username}")
    UserInfo login(UserLoginDto userLoginDto);

    @Select("select * from user_address where user_id=#{id}")
    List<UserAddress> findUserAddressList(Long id);
}
